package com.acwing.partition3;

import java.io.*;

public class AC278数字组合 {

    private static final int N = 110, M = 10010;
    private static int[] f = new int[M];
    private static int n, m;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = nextInt(); m = nextInt();
        f[0] = 1;
        for (int i = 1; i <= n; i++) {
            int x = nextInt();
            for (int j = m; j >= x; j--) {
                f[j] += f[j - x];
            }
        }
        writer.println(f[m]);
        writer.flush();
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
